{% extends 'base.html' %}
{% block titel %}发布管理系统-jenkins配置页{% endblock %}
{% block link %}
    <link rel="stylesheet" href="/static/css/compiled/new-user.css" type="text/css" media="screen" />
    <link rel="stylesheet" type="text/css" href="/static/css/jenkinsxiugaiye.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/lib/font-awesome.css" />
{% endblock %}

{% block body %}
     <div class="content">
        {% if zhuangtai %}
            <div id="zhuangtai2" class="alert alert-success alert-dismissible" role="alert">
        {% else %}
            <div style="display: none"  id="zhuangtai2" class="alert alert-success alert-dismissible" role="alert">
        {% endif %}
		  <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only"></span></button>
		  <strong>保存成功!</strong>
		    </div>
        <div class="container-fluid">
            <div id="pad-wrapper" class="new-user">
                <div class="row-fluid header">
                    <h3>Jenkins 配置</h3>
                    <h5 id="xinghao">* 必填</h5>
                </div>

                <div class="row-fluid form-wrapper">
                    <!-- left column -->
                    <div class="span9 with-sidebar">
                        <div class="container">
                            <form class="new_user_form inline-input" method="post" action="/jenkinsmodify/"/>
                            {% csrf_token %}
                                <div class="span12 field-box">
                                    <label id="zhanghu1">*连接账户:</label>
                                    <input class="span9" type="text" name="username" id="zhanghu" value="{{ modify.username }}" placeholder="登陆jenkins页面用户，如admin"/>
                                </div>
                                <div class="span12 field-box">
                                    <label id="mima1">*密码:</label>
                                    <input class="span9" type="password" name="password" id="mima" value="{{ modify.password }}" placeholder="连接账户密码"/>
                                </div>
                                <div class="span12 field-box">
                                    <label id="urldz1">*URL地址:</label>
                                    <input class="span9" type="text" name="urllocation" id="urldz" value="{{ modify.UrlLocation }}" placeholder="登陆jenkins的URL连接"/>
                                </div>
                                <div class="span12 field-box textarea">
                                    <label>备注:</label>
                                    <textarea class="span9" name="Remark" placeholder="备注及说明">{{ modify.Remark }}</textarea>
                                    <!--<span class="charactersleft">小于256字</span>-->
                                </div>
                                <div class="span11 field-box actions">
                                    <input type="submit" class="btn-glow primary" value="确认修改" onclick="return checkNull()" />
                                    <span>OR</span>
                                    <input type="reset" value="重置" class="reset" />
                                </div>
                            </form>
                        </div>
                    </div>

                    <!-- side right column -->
                    <div class="span3 form-sidebar pull-right">
                        <div class="alert alert-info hidden-tablet">
                            <i class="icon-lightbulb pull-left"></i>
                            	请谨慎填写相关配置，用户名及密码。
                        </div>
                        <!--<h6>Sidebar text for instructions</h6>
                        <p>Add multiple users at once</p>
                        <p>Choose one of the following file types:</p>-->
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- end main container -->
{% endblock %}

{% block javascript %}
    <script type="text/javascript">
        $(document).ready(function(){
            var $canshu=$('#fbmodify');
            var $span=$('<div class="pointer"> <div class="arrow"></div> <div class="arrow_border"></div> </div>');
            $($canshu).append($span);
            $($canshu).addClass("active");
            $('#jenkinsmodify').addClass("active");
            $('#fbmodifyul').addClass("active");
    })
    </script>
    <script type="text/javascript">
        function checkNull()
        {
            var username=$("#zhanghu").val();
            var password=$("#mima").val();
            var urldz=$("#urldz").val();

            if(username==""){
            //显示错误提示信息
            $("#zhanghu").attr('placeholder','不得为空')
            $("#zhanghu1").css('color','red')
            return false;
        }else{
                $("#zhanghu1").css('color','')
            }
        if(password==""){
            $("#mima").attr('placeholder','不得为空')
            $("#mima1").css('color','red')
            return false;
        }else{
            $("#mima1").css('color','')
        }
            if(urldz==""){
            $("#urldz").attr('placeholder','不得为空')
            $("#urldz1").css('color','red')
            return false;
        }else{
                $("#urldz1").css('color','')
            }
        return true;
             };
    </script>
{% endblock %}